﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

/// <summary>
/// Summary description for CCurrentContext
/// </summary>
public class CCurrentContext
{
    //private static CUser _User;
    public static bool IsLogged
    {
        
        get{return HttpContext.Current.Request.Cookies["User"]!= null;}
    }
    public static string UserName
    {
        get{ return HttpContext.Current.Request.Cookies["User"].Value;}
    }
	public CCurrentContext()
	{
		
	}
    public static CUser User
    {
        get { return HttpContext.Current.Session["User"] as CUser; }
        set { HttpContext.Current.Session["User"] = value; }
    }
    //Lay nhanh Giohang
    public static CMyCart Cart
    {
        get { return CCurrentContext.User.Cart; }
    }
}
